package com.fujitsu.nanjing.tieba.dao;

import com.fujitsu.nanjing.tieba.ibator.CoreArchiveReply;
import com.fujitsu.nanjing.tieba.ibator.CoreArchiveReplyCriteria;
import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class CoreArchiveReplyDAOImpl extends SqlMapClientDaoSupport implements CoreArchiveReplyDAO {

    public CoreArchiveReplyDAOImpl() {
        super();
    }

    public int countByExample(CoreArchiveReplyCriteria example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("core_archive_reply.countByExample", example);
        return count;
    }

    public int deleteByExample(CoreArchiveReplyCriteria example) {
        int rows = getSqlMapClientTemplate().delete("core_archive_reply.deleteByExample", example);
        return rows;
    }

    public void insert(CoreArchiveReply record) {
        getSqlMapClientTemplate().insert("core_archive_reply.insert", record);
    }

    public void insertSelective(CoreArchiveReply record) {
        getSqlMapClientTemplate().insert("core_archive_reply.insertSelective", record);
    }

    @SuppressWarnings("unchecked")
    public List<CoreArchiveReply> selectByExampleWithBLOBs(CoreArchiveReplyCriteria example) {
        List<CoreArchiveReply> list = getSqlMapClientTemplate().queryForList("core_archive_reply.selectByExampleWithBLOBs", example);
        return list;
    }

    @SuppressWarnings("unchecked")
    public List<CoreArchiveReply> selectByExampleWithoutBLOBs(CoreArchiveReplyCriteria example) {
        List<CoreArchiveReply> list = getSqlMapClientTemplate().queryForList("core_archive_reply.selectByExample", example);
        return list;
    }

    public int updateByExampleSelective(CoreArchiveReply record, CoreArchiveReplyCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_archive_reply.updateByExampleSelective", parms);
        return rows;
    }

    public int updateByExampleWithBLOBs(CoreArchiveReply record, CoreArchiveReplyCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_archive_reply.updateByExampleWithBLOBs", parms);
        return rows;
    }

    public int updateByExampleWithoutBLOBs(CoreArchiveReply record, CoreArchiveReplyCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_archive_reply.updateByExample", parms);
        return rows;
    }

    protected static class UpdateByExampleParms extends CoreArchiveReplyCriteria {
        private Object record;

        public UpdateByExampleParms(Object record, CoreArchiveReplyCriteria example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}